package com.baimifan.renovation.tools;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.baimifan.renovation.R;


/**
 * 自定义权限申请框
 * Created by baimifan on 2016/5/16.
 */
public class MyrootDialog extends Dialog implements View.OnClickListener{
    private TextView message;
    private Button confirm,cancel;
    private DialogListener listener;
    private String mess;
    public interface DialogListener{
        public void onClick(View view);
    }

    public MyrootDialog(Context context, String message ,DialogListener listener) {
        super(context);
        this.listener = listener;
        this.mess = message;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_myrooot);
        message = (TextView) findViewById(R.id.root_message);
        confirm = (Button) findViewById(R.id.root_confirm);
        cancel = (Button) findViewById(R.id.root_cancel);
        cancel.setOnClickListener(this);
        confirm.setOnClickListener(this);
        message.setText(mess);
    }

    @Override
    public void onClick(View v) {
        listener.onClick(v);
    }
}
